﻿using Company.Demo.Views;
using Company.Share;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Controls;
using System.Windows.Input;
using ToolKit.Mvvm.Attributes;
using ToolKit.Mvvm.Bindings;
using ToolKit.Mvvm.Enums;

namespace Company.Demo.ViewModels
{
    [DependenceInjection(Lifetime.Singleton)]
    internal class MainViewModel : ViewModelBase
    {
        private MainView MainView;
        public ICommand LoadedCommand { get; }
        public ICommand PreviewImageCommand { get;  }
        public ICommand ReceiveDataCommand { get;  }
        public MainViewModel()
        {
            LoadedCommand = new RelayCommand<MainView>(view => MainView = view);
            PreviewImageCommand = new RelayCommand(PreviewImage);
            ReceiveDataCommand = new RelayCommand(ReceiveData);
        }

        private void ReceiveData()
        {
            MainView.previewImage.Content = App.Current.Container.GetService(ViewNames.DataView);
        }

        private void PreviewImage()
        {
            MainView.previewImage.Content = App.Current.Container.GetService(ViewNames.PreviewImageView);
        }
    }
}
